type TupleToObject<T extends readonly (string | number | symbol)[]> = {
    [P in T[number]]:P;
}

// const tuple = ['tesla', 'model 3', 'model X', 'model Y'] as const

// type r = TupleToObject<typeof tuple>



//js
// function TupleToObject(array){
//     const obj = {}

//     array.forEach(val => {
//         obj[val] = val;
//     });

//     return obj
// }


//1. 返回一个对象
//2. 遍历一个数组 [P in T[number]]

